import React from "react";
import getMenuList from "@/router/getMenuList";


function flatList(list){
    return list.flatMap(item=>{
        if(item.children){
            return flatList(item.children)
        }else{
            return item;
        }
    })
}
const routers= () =>{
    const list = flatList(getMenuList());
    return list.map(item=>{
        return {
            path:item.path,
            ele:React.lazy(() => import("../pages/"+(item.path.replace("/ouyu/",""))))
        }
    })
}

export default routers